System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 67
Q1421:
If each thread has its own heap, _______ can be used.
A. HEAP_REALLOC_IN_PLACE_ONLY
B. HEAP_NO_SERIALIZE
C. HEAP_COMPACT
D. HEAP_GENERATE_EXCEPTION
Correct Answer:
B
Chapter: 67
Q1422:
HEAP_NO_SERIALIZE helps when
A. threads share the heap
B. allocation fails
C. threads are independent
D. heap is corrupted
Correct Answer:
C
Chapter: 67
Q1423:
HEAP_GENERATE_EXCEPTION allows the program to _______ before terminating.
A. free memory
B. close open handles
C. log data
D. log errors
Correct Answer:
B
Chapter: 67
Q1424:
STATUS_NO_MEMORY indicates
A. that heap is corrupted
B. that memory is exhausted
C. that serialization is missing
D. that an exception is thrown
Correct Answer:
B
Chapter: 67
Q1425:
STATUS_ACCESS_VIOLATION indicates that the heap
A. has space left
B. has been corrupted
C. is full
D. has low fragmentation
Correct Answer:
B
Chapter: 67
Q1426:
Heap exceptions help the program to
A. allocate more memory
B. handle concurrency
C. manage open handles
D. validate thread safety
Correct Answer:
C
Chapter: 67
Q1427:
_______ can be used to enable low fragmentation mode.
A. HeapSize()
B. HeapSetInformation()
C. HeapReAlloc()
D. HeapCompact()
Correct Answer:
B
Chapter: 67
Q1428:
HeapCompact() is used to
A. find largest free block
B. enable exceptions
C. enumerate memory
D. terminate thread
Correct Answer:
A
Chapter: 67
Q1429:
HeapValidate() is used to
A. compact memory
B. detect corruption
C. reallocate memory
D. set information
Correct Answer:
B
Chapter: 67
Q1430:
HeapWalk() helps in _______.
A. corrupting memory
B. locking heap
C. validating heap
D. enumerating allocated blocks
Correct Answer:
D
Chapter: 67
Q1431:
HeapLock() is used to
A. terminate a heap
B. lock access to heap
C. compact heap
D. check heap size
Correct Answer:
B
Chapter: 67
Q1432:
HeapUnLock() is used to
A. enable fragmentation
B. unlock access to heap
C. terminate heap
D. initialize memory
Correct Answer:
B
Chapter: 67
Q1433:
HeapWalk() is used for
A. heap validation
B. thread creation
C. block enumeration
D. exception handling
Correct Answer:
C
Chapter: 67
Q1434:
The flag _______ indicates that heap has been accessed out of bounds.
A. STATUS_NO_MEMORY
B. STATUS_ACCESS_VIOLATION
C. HEAP_NO_SERIALIZE
D. HEAP_COMPACT
Correct Answer:
B
Chapter: 67
Q1435:
To allow thread termination on heap corruption, use
A. HeapReAlloc()
B. HeapWalk()
C. HeapSetInformation()
D. HeapValidate()
Correct Answer:
C
Chapter: 68
Q1436:
Which API is used to create a new heap?
A. HeapAlloc()
B. HeapCreate()
C. HeapFree()
D. HeapDestroy()
Correct Answer:
B
Chapter: 68
Q1437:
To obtain a handle to the default heap of the current process, which API is used?
A. HeapCreate()
B. GetProcessHeap()
C. HeapAlloc()
D. HeapFree()
Correct Answer:
B
Chapter: 68
Q1438:
Memory blocks are allocated from a heap using _______.
A. HeapFree()
B. HeapAlloc()
C. HeapDestroy()
D. HeapSize()
Correct Answer:
B
Chapter: 68
Q1439:
If a memory block needs to be deallocated, the correct API to use is _______.
A. HeapAlloc()
B. HeapCreate()
C. HeapFree()
D. HeapDestroy()
Correct Answer:
C
Chapter: 68
Q1440:
Before terminating the program, the heap should be disposed of using _______.
A. HeapFree()
B. HeapCreate()
C. HeapDestroy()
D. HeapAlloc()
Correct Answer:
C