Pass-by-reference instead of pointer.

This commit is contained in:
Daniel Patterson
2016-11-14 21:44:16 -08:00
parent d8b016b92a
commit 83a9d0590d
5 changed files with 154 additions and 163 deletions
-1
View File
@@ -122,7 +122,6 @@ class FileReader
{
while (std::getline(input_stream, thisline))
{
std::clog << "Read " << thisline << std::endl;
result.push_back(thisline);
}
}
+1 -1
View File
@@ -142,7 +142,7 @@ struct DataLayout
}
template <typename T, bool WRITE_CANARY = false>
inline T *GetBlockPtr(char *shared_memory, BlockID bid)
inline T *GetBlockPtr(char *shared_memory, BlockID bid) const
{
T *ptr = (T *)(shared_memory + GetBlockOffset(bid));
if (WRITE_CANARY)
+2 -2
View File
@@ -53,8 +53,8 @@ class Storage
ReturnCode Run(int max_wait);
void LoadLayout(DataLayout *layout);
void LoadData(DataLayout *layout_ptr, char *memory_ptr);
void PopulateLayout(DataLayout &layout);
void PopulateData(const DataLayout &layout, char *memory_ptr);
private:
StorageConfig config;