Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

run ok

  • Loading branch information...
commit 4c0d4ea791ef3b32c3d59650238c2ec1cbd72598 1 parent 2a4bf66
@Yemsheng authored
View
9 BuddyMem.cpp
@@ -100,7 +100,8 @@ char* BuddyMem::BuddyMemMalloc(const unsigned int size)
LinkNode *usedNode = new LinkNode;
usedNode->address = pAlloc;
usedNode->next = NULL;
- insertNodeToTableLinkList(m_usedTableLinkListArray,tableIndex,usedNode);
+ //insertNodeToTableLinkList(m_usedTableLinkListArray,tableIndex,usedNode);
+ insertNodeToUsedableLinkList(tableIndex, usedNode);
//3、从链表头节点保存的内存空间拆分成新的节点,添加到empty表
int i = 0;
@@ -111,7 +112,8 @@ char* BuddyMem::BuddyMemMalloc(const unsigned int size)
emptyNode = new LinkNode;
emptyNode->address = pInsert;
emptyNode->next = NULL;
- insertNodeToTableLinkList(m_emptyTableLinkListArray,i,emptyNode);
+ //insertNodeToTableLinkList(m_emptyTableLinkListArray,i,emptyNode);
+ insertNodeToEmptyTableLinkList(i, emptyNode);
pInsert = pInsert + m_blockSize*getBlockAmountFromIndex(i);
}
@@ -152,7 +154,8 @@ void BuddyMem::BuddyMemFree(char *pMem)
nodeFind->next = NULL;
memset(nodeFind->address, 0, m_blockSize*getBlockAmountFromIndex(index));
//把该节点插入empty表中
- insertNodeToTableLinkList(m_emptyTableLinkListArray,index,nodeFind);
+ //insertNodeToTableLinkList(m_emptyTableLinkListArray,index,nodeFind);
+ insertNodeToEmptyTableLinkList(index, nodeFind);
}
View
BIN  BuddyMem.ncb
Binary file not shown
View
BIN  BuddyMem.opt
Binary file not shown
View
12 BuddyMem.plg
@@ -6,22 +6,22 @@
--------------------Configuration: BuddyMem - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP152.tmp" with contents
+Creating temporary file "H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP193.tmp" with contents
[
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"Debug/" /Fp"Debug/BuddyMem.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"E:\project\BuddyMem\main.cpp"
+"E:\project\BuddyMem\BuddyMem.cpp"
]
-Creating command line "cl.exe @H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP152.tmp"
-Creating temporary file "H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP153.tmp" with contents
+Creating command line "cl.exe @H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP193.tmp"
+Creating temporary file "H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP194.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/BuddyMem.pdb" /debug /machine:I386 /out:"Debug/BuddyMem.exe" /pdbtype:sept
.\Debug\BuddyMem.obj
.\Debug\main.obj
]
-Creating command line "link.exe @H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP153.tmp"
+Creating command line "link.exe @H:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP194.tmp"
<h3>Output Window</h3>
Compiling...
-main.cpp
+BuddyMem.cpp
Linking...
Creating command line "bscmake.exe /nologo /o"Debug/BuddyMem.bsc" .\Debug\BuddyMem.sbr .\Debug\main.sbr"
Creating browse info file...
View
BIN  Debug/BuddyMem.bsc
Binary file not shown
View
BIN  Debug/BuddyMem.exe
Binary file not shown
View
BIN  Debug/BuddyMem.ilk
Binary file not shown
View
BIN  Debug/BuddyMem.obj
Binary file not shown
View
BIN  Debug/BuddyMem.pdb
Binary file not shown
View
BIN  Debug/main.obj
Binary file not shown
View
BIN  Debug/vc60.idb
Binary file not shown
View
BIN  Debug/vc60.pdb
Binary file not shown
View
4 main.cpp
@@ -11,8 +11,8 @@ int main()
buddyMem.BuddyMemCreate();
char *p1 = buddyMem.BuddyMemMalloc(3);
buddyMem.BuddyMemFree(p1);
- char *p2 = buddyMem.BuddyMemMalloc(33);
- char *p3 = buddyMem.BuddyMemMalloc(33);
+ //char *p2 = buddyMem.BuddyMemMalloc(33);
+ //char *p3 = buddyMem.BuddyMemMalloc(33);
buddyMem.BuddyMemDestroy();
return 0;
Please sign in to comment.
Something went wrong with that request. Please try again.