Explore chapters and articles related to this topic
Reliability and fault-finding
Published in Mike Tooley, PC Based Instrumentation and Control, 2013
All protection violations that do not cause another exception result in a general protection fault (GPF). These can be caused by: Exceeding the segment limit when using the CS, DS, ES, FS, or GS segments. This is a very common problem in programs and it is usually caused when a program miscalculates how much memory is required in an allocation.Transferring execution to a segment that is not executable (e.g., jumping to a location that contains garbage).Writing to a read-only area or to a Code segment.Loading a bad value into a Segment Register.Using a null pointer. A value of zero (i.e. 0) is defined as a null pointer. When operating in Protected Mode, it is always invalid to use a Segment Register that contains zero.
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
Pointers are the key to dynamic memory allocation for vectors and arrays and for passing variables to functions in a manner that will allow their values to be altered. To address the first point note that in C++ there are three memory storage types: automatic storage (or “the stack”), static storage and the free-store or the heap. The free-store is a large block of memory used for allocation of memory at run-time. It is what should be used if there is any uncertainty about precisely how much memory will be needed when you run your program. This, of course, is a common occurrence in many statistical applications where code should be able to adapt to data sets of general sizes that may not be determined until run time. Even in the context of our random number generation programs in the next chapter, the size of the vector of random numbers they produce needs to be determined at run-time and could be arbitrarily large depending on the needs of the user.
C Programming
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
One of the most powerful features of C, and one that is most difficult to master, is the pointer type. A variable that is declared as a pointer is one that holds the address of another variable. Thus, the pointer variable “points” to another memory location. Although in C every pointer variable requires the same amount of space in the computer’s memory, each is declared to point to a particular type of value. That is, we can declare a variable to be a pointer to an integer, or a pointer to a float, etc. A pointer declaration is indicated with an asterisk *. Figure 13.9 gives examples of pointer variable declarations.
Research on evacuation simulation of underground commercial street based on reciprocal velocity obstacle model
Published in Journal of Asian Architecture and Building Engineering, 2022
Wei Li, Zhilong Chen, Jiheng Xu, Wenbo Wang, Ping Zhang
According to the location of the evacuation exit, the commercial street model was first divided into different evacuation levels into various regions, and then the evacuation path tree was generated. According to the distance from the evacuation exit, the flow direction of evacuation in the underground street, was determined, and then the evacuation levels of shops, passageways, exits, stairway lobby, stairway and other spaces to 1, 2, 3, 4 and 5 were set (Figure 2), respectively. Meanwhile, the evacuation levels also indicate the degree of evacuation difficulty in each area of the commercial street. Then, the evacuation path tree (Figure 3) was generated through the evacuation levels. In the evacuation path tree, each node represents space, and the data structure of the node is composed of two coordinates for the lower left and upper right of the space and a pointer to the parent node.
Solving steel coil ship stowage-planning problem using hybrid differential evolution
Published in International Journal of Production Research, 2019
From the above survey, we can discern that metaheuristics are widely used in solving the stowage-planning problem. DE is a population-based stochastic searching algorithm proposed by Storn and Price (1997), which achieved outstanding performance in solving the benchmark function, and has been successfully applied in numerous engineering fields (Das and Suganthan 2011; Chen et al. 2014; Tang, Zhao, and Liu 2014; Tang, Dong, and Liu 2015; Wang and Tang 2016; Yang, Zhou, and Tsui 2016). The classic DE is designed for the continuous optimisation problems, i.e. its individuals are encoded in real numbers. In practice, however, there are also many discrete optimisation problems. To fully exploit the searching ability of DE, discrete variants with integer encoding have been developed, such as HDE (Qian et al. 2009), HDDE (Wang et al. 2010), HPDE (Dong and Wang 2012), PDDE (Dong, Guo, and Tang 2013), and DDE with hybrid mutation (Peng and Huang 2014). PDDE, which is pointer-based discrete DE, redefines the mutation strategy using a pair of reciprocal discrete operators in the C++ programming language, i.e. pointer and address-of. Following the basic structure of DE, PDDE can be improved to obtain outstanding performance and has the potential to solve complex discrete optimisation problems.
Skip compactors for garbage collection based on space utilization
Published in Journal of the Chinese Institute of Engineers, 2018
Yi-Wen Peng, Tien-Hsing Hsu, Wei-Mei Chen
Mark-compact collection requires a long collection time because it moves all live objects and accesses dead objects to avoid the overwriting of live objects. We propose the skip compactor (SC) for garbage collection based on two main ideas: ‘avoid accessing dead objects’ and ‘reduce the number of relocations,’ for reducing the collection time. We calculate the total size of live objects in each region in the mark phase. In the calculate location phase, contiguous dead objects are merged into a chunk, and live objects remain in the high space utilization region. Here, the high space utilization region means the ratio of the total size of live objects to the region size is high. Subsequently, through the object reference pointer, we can trace each live object and update its reference pointer. Finally, in the compaction phase, live objects in the high space utilization region are skipped, and dead objects are not visited by the ends of chunks.