Home | History | Annotate | Download | only in lib

Lines Matching defs:this

5  * you may not use this file except in compliance with the License.
217 picoos_Common this = (picoos_Common) picoos_allocate(mm,sizeof(*this));
218 if (NULL != this) {
220 this->em = NULL;
221 this->mm = NULL;
222 this->fileList = NULL;
224 return this;
227 void picoos_disposeCommon(picoos_MemoryManager mm, picoos_Common * this)
229 if (NULL != (*this)) {
231 picoos_deallocate(mm,(void *)this);
305 static int os_init_mem_block(picoos_MemoryManager this)
312 isFirstBlock = (this->freeCells == NULL);
313 newBlockAddr = (void *) this->lastBlock->data;
314 size = this->lastBlock->size;
316 cmid = (MemCellHdr)((picoos_objsize_t)newBlockAddr + this->fullCellHdrSize);
318 - this->fullCellHdrSize);
322 cmid->size = size - 2 * this->fullCellHdrSize;
333 this->freeCells = cbeg;
334 this->lastFree = cend;
339 cmid->nextFree = this->freeCells->nextFree;
340 cmid->prevFree = this->freeCells;
357 picoos_MemoryManager this;
361 this = picoos_raw_malloc(raw_memory, size, sizeof(memory_manager_t),
363 if (this == NULL) {
378 this->firstBlock = NULL;
379 this->lastBlock = NULL;
380 this->freeCells = NULL;
381 this->lastFree = NULL;
383 this->protMem = enableMemProt;
384 this->usedSize = 0;
385 this->prevUsedSize = 0;
386 this->maxUsedSize = 0;
389 this->fullCellHdrSize = ((sizeof(mem_cell_hdr_t) + PICOOS_ALIGN_SIZE - 1)
395 this->usedCellHdrSize = (picoos_objsize_t) &test_cell.size
399 if (size2 > this->usedCellHdrSize) {
400 this->usedCellHdrSize = size2;
404 this->minContSize = this->fullCellHdrSize - this->usedCellHdrSize;
406 this->minCellSize = this->fullCellHdrSize + PICOOS_ALIGN_SIZE;
411 this->firstBlock = this->lastBlock = picoos_raw_malloc(raw_memory, size,
413 if (this->lastBlock == NULL) {
416 this->lastBlock->next = NULL;
417 this->lastBlock->data = rest_mem;
418 this->lastBlock->size = rest_mem_size;
420 os_init_mem_block(this);
422 return this;
477 picoos_MemoryManager this,
483 *usedBytes = (picoos_int32) this->usedSize;
484 *incrUsedBytes = (picoos_int32) (this->usedSize - this->prevUsedSize);
485 *maxUsedBytes = (picoos_int32) this->maxUsedSize;
487 this->prevUsedSize = this->usedSize;
492 void picoos_showMemUsage(picoos_MemoryManager this
497 picoos_getMemUsage(this, resetIncremental, &usedBytes, &incrUsedBytes,
507 void * picoos_allocate(picoos_MemoryManager this,
515 if (byteSize < this->minContSize) {
516 byteSize = this->minContSize;
521 cellSize = byteSize + this->usedCellHdrSize;
523 c = this->freeCells->nextFree;
527 (c->size < (picoos_ptrdiff_t)(cellSize+ this->minCellSize))) {
550 this->usedSize += cellSize;
551 if (this->usedSize > this->maxUsedSize) {
552 this->maxUsedSize = this->usedSize;
556 adr = (void *)((picoos_objsize_t)c + this->usedCellHdrSize);
560 void picoos_deallocate(picoos_MemoryManager this, void * * adr)
569 c = (MemCellHdr)((picoos_objsize_t)(*adr) - this->usedCellHdrSize);
574 this->usedSize -= c->size;
599 c->nextFree = this->freeCells->nextFree;
600 c->prevFree = this->freeCells;
631 void picoos_emReset(picoos_ExceptionManager this)
633 this->curExceptionCode = PICO_OK;
634 this->curExceptionMessage[0] = '\0';
635 this->curNumWarnings = 0;
640 picoos_ExceptionManager this = (picoos_ExceptionManager) picoos_allocate(
641 mm, sizeof(*this));
642 if (NULL != this) {
644 picoos_emReset(this);
646 return this;
650 picoos_ExceptionManager * this)
652 if (NULL != (*this)) {
654 picoos_deallocate(mm, (void *)this);
817 /* For convenience, this function returns the resulting current exception code. The return value therefore is NOT the status of raising
819 pico_status_t picoos_emRaiseException(picoos_ExceptionManager this,
825 if (PICO_OK == this->curExceptionCode && PICO_OK != exceptionCode) {
826 this->curExceptionCode = exceptionCode;
828 picoos_vSetErrorMsg(this->curExceptionMessage,PICOOS_MAX_EXC_MSG_LEN, exceptionCode, baseMessage, fmt,args);
831 this->curExceptionCode, this->curExceptionMessage));
836 return this->curExceptionCode;
839 pico_status_t picoos_emGetExceptionCode(picoos_ExceptionManager this)
841 return this->curExceptionCode;
844 void picoos_emGetExceptionMessage(picoos_ExceptionManager this, picoos_char * msg, picoos_uint16 maxsize)
846 picoos_strlcpy(msg,this->curExceptionMessage,maxsize);
849 void picoos_emRaiseWarning(picoos_ExceptionManager this,
853 if ((this->curNumWarnings < PICOOS_MAX_NUM_WARNINGS) && (PICO_OK != warningCode)) {
854 if (PICOOS_MAX_NUM_WARNINGS-1 == this->curNumWarnings) {
855 this->curWarningCode[this->curNumWarnings] = PICO_EXC_MAX_NUM_EXCEED;
856 picoos_strlcpy(this->curWarningMessage[this->curNumWarnings],(picoos_char *) "too many warnings",PICOOS_MAX_WARN_MSG_LEN);
858 this->curWarningCode[this->curNumWarnings] = warningCode;
860 picoos_vSetErrorMsg(this->curWarningMessage[this->curNumWarnings],PICOOS_MAX_WARN_MSG_LEN, warningCode, baseMessage, fmt,args);
863 this->curNumWarnings++;
867 this->curWarningCode[this->curNumWarnings-1],
868 this->curWarningMessage[this->curNumWarnings-1],
869 this->curNumWarnings));
872 picoos_uint8 picoos_emGetNumOfWarnings(picoos_ExceptionManager this)
874 return this->curNumWarnings;
877 pico_status_t picoos_emGetWarningCode(picoos_ExceptionManager this, picoos_uint8 index)
879 if (index < this->curNumWarnings) {
880 return this->curWarningCode[index];
886 void picoos_emGetWarningMessage(picoos_ExceptionManager this, picoos_uint8 index, picoos_char * msg, picoos_uint16 maxsize)
888 if (index < this->curNumWarnings) {
889 picoos_strlcpy(msg,this->curWarningMessage[index],maxsize);
946 picoos_File this = (picoos_File) picoos_allocate(mm, sizeof(*this));
947 if (NULL != this) {
950 return this;
953 void picoos_disposeFile(picoos_MemoryManager mm, picoos_File * this)
955 if (NULL != (*this)) {
957 picoos_deallocate(mm, (void *)this);
1287 'pos' bytes from beginning (first byte = byte 0). This
1968 /* search for svox header somewhere near the file start. This allows for initial
2155 /* this function is case-sensitive */