• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libcsc-0.82.3/src/

Lines Matching refs:memList

48 	CSCmemDone - cleanup and remove a memList (free all its memory)
49 CSCmemAlloc - allocate memory (and keep thrack of it in memList)
52 CSCmemLookup - lookup a memory pointer in memList
53 CSCmemValidate - validate that a memory pointer is in memList
54 CSCmemListFree - free all memory allocated in a memList
55 CSCmemListStat - get information about a memList
250 S_memListType* const memList,
255 S_memListType* const memList,
266 S_memListType* const memList,
272 S_memListType* const memList,
278 PRIVATE void mlWriteName (int fd, const S_memListType* memList);
279 PRIVATE void mlWriteTfnc (int fd, const S_memListType* memList);
280 PRIVATE void mlWriteMfnc (int fd, const S_memListType* memList);
281 PRIVATE void mlWriteProf (int fd, const S_memListType* memList);
283 PRIVATE void mlWriteAlloc (int fd, const S_memListType* memList);
284 PRIVATE void mlWriteFreed (int fd, const S_memListType* memList);
285 PRIVATE void mlWriteCurAl (int fd, const S_memListType* memList);
286 PRIVATE void mlWriteMaxAl (int fd, const S_memListType* memList);
289 const S_memListType* memList,
303 S_memListType* const memList,
312 if (block == memList->list)
331 memList->list = SUCC(block);
332 if (memList->list != NULL) PRED(memList->list) = NULL;
391 S_memListType* const memList,
406 MON_ENTER (memList);
408 SUCC(block) = memList->list;
411 if (memList->list != NULL) PRED(memList->list) = block;
412 memList->list = block;
414 if (memList->profiling == CSC_DO_PROFILING)
416 memList->allocCount += 1;
417 memList->curAlloc += block->size;
418 if (memList->curAlloc > memList->maxAlloc)
420 memList->maxAlloc = memList->curAlloc;
424 MON_EXIT (memList);
470 S_memListType* const memList,
480 if (memList->profiling == CSC_DO_PROFILING)
482 memList->curAlloc -= block->size;
483 memList->freeCount += 1;
489 delStat = blockUnlink (memList, block);
508 S_memListType* const memList,
518 MON_ENTER (memList);
520 b = memList->list;
549 delStat = blockDel (memList, block, tagData);
553 MON_EXIT (memList);
563 PRIVATE void mlWriteName (int fd, const S_memListType* memList)
565 (void)write (fd, memList->name, strlen(memList->name));
574 PRIVATE void mlWriteTfnc (int fd, const S_memListType* memList)
576 if (memList->tagFunc != NULL)
587 PRIVATE void mlWriteMfnc (int fd, const S_memListType* memList)
589 if (memList->monFunc != NULL)
600 PRIVATE void mlWriteProf (int fd, const S_memListType* memList)
602 if (memList->profiling == CSC_DO_PROFILING)
613 PRIVATE void mlWriteAlloc (int fd, const S_memListType* memList)
617 (void)sprintf (numbuf, "%d\n", memList->allocCount);
628 PRIVATE void mlWriteFreed (int fd, const S_memListType* memList)
632 (void)sprintf (numbuf, "%d\n", memList->freeCount);
643 PRIVATE void mlWriteCurAl (int fd, const S_memListType* memList)
647 (void)sprintf (numbuf, "%d\n", memList->curAlloc);
658 PRIVATE void mlWriteMaxAl (int fd, const S_memListType* memList)
662 (void)sprintf (numbuf, "%d\n", memList->maxAlloc);
674 const S_memListType* memList,
717 if ((memList->tagFunc != NULL) && (block->allocTag != 0))
719 tagStr = (*memList->tagFunc)(block->allocTag);
732 if ((memList->tagFunc != NULL) && (block->freeTag != 0))
734 tagStr = (*memList->tagFunc)(block->freeTag);
853 S_memListType* memList = NULL;
855 memList = (S_memListType*)CSC_MALLOC_FUNC (1, sizeof(S_memListType));
856 if (memList != NULL)
858 memList->list = NULL;
859 memList->name = name;
860 memList->profiling = profiling;
861 memList->tagFunc = tagFunc;
862 memList->monFunc = monFunc;
863 memList->monData = (void*)monData;
864 memList->allocCount = 0;
865 memList->freeCount = 0;
866 memList->curAlloc = 0;
867 memList->maxAlloc = 0;
869 memList->sig_lo = MEM_SIG;
870 memList->sig_hi = MEM_SIG;
874 return (memList);
885 CSCmemDone - cleanup and remove a memList (free all its memory)
890 int CSCmemDone (CSCmemListType const memList);
895 CSC_BADARG ..... memList is NULL
897 CSC_CORRUPT .... corruption is detected in memList
902 `memList' and then removes `memList' itself. `memList' is not checked
903 for profiling; no statistics for `memList' are retained.
905 Do not try to use `memList' after calling CSCmemDone(), at least until
906 using `memList' in another CSCmemInit().
928 PUBLIC int (CSCmemDone) (CSCmemListType const memList)
932 ASSERT_RTN (memList != NULL, "CSCmemDone: NULL memList", CSC_BADARG);
935 memList->sig_lo == MEM_SIG, \
936 "CSCmemDone: memList blows", \
940 memList->sig_hi == MEM_SIG, \
941 "CSCmemDone: memList blows", \
945 if (memList == NULL) return (CSC_BADARG);
947 MON_ENTER(memList);
951 S_memBlockType* block = memList->list;
962 S_memBlockType* block = memList->list;
981 CSCmonFnType monFunc = memList->monFunc;
982 void* monData = memList->monData;
984 (void)memset (memList, GARBAGE_DATA, sizeof(memList)); /* scribble */
986 (void)CSC_FREE_FUNC (memList);
1002 CSCmemAlloc - allocate memory (and keep thrack of it in memList)
1008 CSCmemListType const memList,
1020 CSC_BADARG ..... memList or memPtrPtr is NULL or itemCount or itemSize
1023 CSC_CORRUPT .... corruption is detected in memList
1030 Multiple calls to CSCmemAlloc() can use the same `memList'; each
1031 allocated memory block will be put into `memList' and CSCmemFree() can
1032 be called with `memList' to free the block, or CSCmemListFree() can be
1033 called to free all the memory blocks in `memList'.
1035 NOTE `memList' must first be created with CSCmemInit().
1041 `tagData' is provided for profiling `memList's. When profiling,
1042 `memList' continues to contain a record of the allocation and free of
1047 `memList'.
1079 CSCmemListType const memList,
1090 memList != NULL, \
1091 "CSCmemAlloc: NULL memList", \
1105 memList->sig_lo == MEM_SIG, \
1106 "CSCmemAlloc: memList blows", \
1110 memList->sig_hi == MEM_SIG, \
1111 "CSCmemAlloc: memList blows", \
1115 if ((memList == NULL) || (memPtrPtr == NULL) || (allocSize == 0))
1146 allocStat = blockPush (memList, block);
1177 CSCmemListType const memList,
1188 CSC_BADARG ..... memList, dstPtrPtr, or srcPtr is NULL or size is zero
1190 CSC_CORRUPT .... corruption is detected in memList
1197 `tagData' is provided for profiling `memList's. When profiling,
1198 `memList' continues to contain a record of the allocation and free of
1203 `memList'.
1235 CSCmemListType const memList,
1244 ASSERT_RTN (memList != NULL, "CSCmemDup: NULL memList", CSC_BADARG);
1250 memList->sig_lo == MEM_SIG, \
1251 "CSCmemDup: memList blows", \
1255 memList->sig_hi == MEM_SIG, \
1256 "CSCmemDup: memList blows", \
1260 #define I_HAVE_A_BAD_ARGUMENT (memList == NULL) || \
1267 dupStat = CSCmemAlloc (memList, dstPtrPtr, 1, size, tagData);
1287 CSCmemListType const memList,
1293 CSC_OK ......... successful, memPtr was found in memList, and the
1296 CSC_NOTFOUND ... memPtr not found in memList, or memList has no
1299 CSC_BADARG ..... memList or memPtrPtr is NULL
1301 CSC_CORRUPT .... corruption is detected in memList
1307 in `memList'. If it is not found in `memList', then no memory is freed.
1309 Because of the `memList' usage, don't use CSCmemFree() on memory you got
1317 `tagData' is provided for profiling `memList's. When profiling,
1318 `memList' continues to contain a record of the allocation and free of
1323 `memList'.
1355 CSCmemListType const memList,
1362 ASSERT_RTN (memList != NULL, "CSCmemFree: NULL memList", CSC_BADARG);
1366 memList->sig_lo == MEM_SIG, \
1367 "CSCmemFree: memList blows", \
1371 memList->sig_hi == MEM_SIG, \
1372 "CSCmemFree: memList blows", \
1376 if ((memList == NULL) || (memPtrPtr == NULL)) return (CSC_BADARG);
1380 freeStat = blockFindAndDel (memList, *memPtrPtr, tagData, &size);
1402 CSCmemLookup - lookup a memory pointer in memList
1408 CSCmemListType const memList,
1415 CSC_OK ......... successful, memPtr was found in memList
1417 CSC_NOTFOUND ... memPtr not found in memList, or memList has no
1420 CSC_BADARG ..... memList or memPtr is NULL
1422 CSC_CORRUPT .... corruption is detected in memList
1426 CSCmemLookup() looks up `memPtr' in `memList' to validate it, and if
1457 CSCmemListType const memList,
1467 ASSERT_RTN (memList != NULL, "CSCmemLookup: NULL memList", CSC_BADARG);
1471 memList->sig_lo == MEM_SIG, \
1472 "CSCmemLookup: memList blows", \
1476 memList->sig_hi == MEM_SIG, \
1477 "CSCmemLookup: memList blows", \
1481 if ((memList == NULL) || (memPtr == NULL)) return (CSC_BADARG);
1483 MON_ENTER(memList);
1485 block = memList->list;
1512 MON_EXIT(memList);
1525 CSCmemValidate - validate that a memory pointer is in memList
1531 CSCmemListType const memList,
1536 CSC_OK ......... successful, memPtr was found in memList
1538 CSC_NOTFOUND ... memPtr not found in memList, or memList has no
1541 CSC_BADARG ..... memList is or memPtr NULL
1543 CSC_CORRUPT .... corruption is detected in memList
1547 CSCmemValidate() looks up `memPtr' in `memList' to validate it.
1565 CSCmemListType const memList,
1573 ASSERT_RTN (memList != NULL, "CSCmemValidate: NULL memList", CSC_BADARG);
1577 memList->sig_lo == MEM_SIG, \
1578 "CSCmemValidate: memList blows", \
1582 memList->sig_hi == MEM_SIG, \
1583 "CSCmemValidate: memList blows", \
1587 if ((memList == NULL) || (memPtr == NULL)) return (CSC_BADARG);
1589 MON_ENTER(memList);
1591 block = memList->list;
1613 MON_EXIT(memList);
1626 CSCmemListFree - free all memory allocated in a memList
1632 CSCmemListType const memList,
1639 CSC_NOTFOUND ... memList has no allocated blocks
1641 CSC_BADARG ..... memList is NULL
1643 CSC_CORRUPT .... corruption is detected in memList
1647 CSCmemListFree() frees all the memory described by `memList'. This is
1648 memory allocations for client code that was allocated by using `memList'
1649 with functions like CSCmemAlloc(). The actual `memList' itself is not
1655 `tagData' is provided for profiling `memList's. When profiling, the
1656 `memList' continues to contain a record of the allocation and free of
1661 `memList'.
1679 CSCmemListType const memList,
1685 ASSERT_RTN (memList != NULL, "CSCmemListFree: NULL memList", CSC_BADARG);
1688 memList->sig_lo == MEM_SIG, \
1689 "CSCmemListFree: memList blows", \
1693 memList->sig_hi == MEM_SIG, \
1694 "CSCmemListFree: memList blows", \
1698 if (memList == NULL) return (CSC_BADARG);
1700 MON_ENTER(memList);
1702 if (memList->list == NULL) freeStat = CSC_NOTFOUND;
1706 S_memBlockType* block = memList->list;
1719 S_memBlockType* block = memList->list;
1730 freeStat = blockDel (memList, block, tagData);
1745 MON_EXIT(memList);
1758 CSCmemListStat - get information about a memList
1764 CSCmemListType const memList,
1774 CSC_NO_PROFILING ... memList is not profiling
1776 CSC_BADARG ......... memList is NULL
1778 CSC_CORRUPT ........ corruption is detected in memList
1783 allocating, and highest allocation from `memList', if `memList' was
1804 CSCmemListStat() can be used to determine if `memList' is profiling by
1806 and `curMemAllocPtr'. CSC_NO_PROFILING is returned if `memList' is not
1807 profiling and CSC_OK is returned if `memList' is profiling.
1825 CSCmemListType const memList,
1834 ASSERT_RTN (memList != NULL, "CSCmemListStat: NULL memList", CSC_BADARG);
1837 memList->sig_lo == MEM_SIG, \
1838 "CSCmemListStat: memList blows", \
1842 memList->sig_hi == MEM_SIG, \
1843 "CSCmemListStat: memList blows", \
1847 if (memList == NULL) return (CSC_BADARG);
1849 MON_ENTER(memList);
1851 if (memList->profiling == CSC_DO_PROFILING)
1853 if (allocCountPtr != NULL) *allocCountPtr = memList->allocCount;
1854 if (freeCountPtr != NULL) *freeCountPtr = memList->freeCount;
1855 if (maxMemAllocPtr != NULL) *maxMemAllocPtr = memList->curAlloc;
1856 if (curMemAllocPtr != NULL) *curMemAllocPtr = memList->maxAlloc;
1861 MON_EXIT(memList);
1880 CSCmemListType const memList,
1887 CSC_BADARG .... memList is NULL
1889 CSC_CORRUPT ... corruption is detected in memList
1894 the dynamically allocated memory blocks that are described in `memList'.
1915 CSCmemListType const memList,
1922 memList != NULL, \
1923 "CSCmemListPrintProfile: NULL memList", \
1927 memList->sig_lo == MEM_SIG, \
1928 "CSCmemListPrintProfile: memList blows", \
1932 memList->sig_hi == MEM_SIG, \
1933 "CSCmemListPrintProfile: memList blows", \
1937 if (memList == NULL) return (CSC_BADARG);
1939 printStat = CSCmemListWriteProfile (memList, STDOUT_FILENO, showing);
1958 CSCmemListType const memList,
1966 CSC_BADARG .... memList is NULL
1968 CSC_CORRUPT ... corruption is detected in memList
1973 dynamically allocated memory blocks that are described in `memList'.
1980 specified when `memList' was created by CSCmemInit(). If `memList' was
1988 called CSCmemAlloc(). If `memList' was specified to be profiling, then
2012 CSCmemListType const memList,
2020 memList != NULL, \
2021 "CSCmemListWriteProfile: NULL memList", \
2030 memList->sig_lo == MEM_SIG, \
2031 "CSCmemListWriteProfile: memList blows", \
2035 memList->sig_hi == MEM_SIG, \
2036 "CSCmemListWriteProfile: memList blows", \
2040 if (memList == NULL) return (CSC_BADARG);
2046 MON_ENTER(memList);
2049 (void)write (fd, " name: ", 20); (void)mlWriteName (fd, memList);
2050 (void)write (fd, " tag function: ", 20); (void)mlWriteTfnc (fd, memList);
2051 (void)write (fd, " monitor function: ", 20); (void)mlWriteMfnc (fd, memList);
2052 (void)write (fd, " profiling: ", 20); (void)mlWriteProf (fd, memList);
2054 if (memList->profiling == CSC_DO_PROFILING)
2056 (void)write (fd, " allocate count: ", 20); (void)mlWriteAlloc (fd, memList);
2057 (void)write (fd, " free count: ", 20); (void)mlWriteFreed (fd, memList);
2058 (void)write (fd, "current allocation: ", 20); (void)mlWriteCurAl (fd, memList);
2059 (void)write (fd, "highest allocation: ", 20); (void)mlWriteMaxAl (fd, memList);
2066 S_memBlockType* block = memList->list;
2075 (void)blockWriteProfile (memList, fd, block);
2082 MON_EXIT(memList);