Merge pull request #287 from universeroc/master
Check memory allocation after malloc
This commit is contained in:
commit
1b00a4a8d6
|
@ -29,7 +29,7 @@ INTERVAL(1M) SLIDING(30S) </code></pre></li>
|
||||||
<p>Inside TDengine shell, you can use the command "show streams" to list the ongoing continuous queries, the command "kill stream" to kill a specific continuous query. </p>
|
<p>Inside TDengine shell, you can use the command "show streams" to list the ongoing continuous queries, the command "kill stream" to kill a specific continuous query. </p>
|
||||||
<p>If you drop a table generated by the continuous query, the query will be removed too.</p>
|
<p>If you drop a table generated by the continuous query, the query will be removed too.</p>
|
||||||
<a class='anchor' id='Publisher/Subscriber'></a><h2>Publisher/Subscriber</h2>
|
<a class='anchor' id='Publisher/Subscriber'></a><h2>Publisher/Subscriber</h2>
|
||||||
<p>Time series data is a sequence of data points over time. Inside a table, the data points are stored in order of timestamp. Also, there is a data retention policy, the data points will be removed once their lifetime is passed. From another view, a table in DTengine is just a standard message queue. </p>
|
<p>Time series data is a sequence of data points over time. Inside a table, the data points are stored in order of timestamp. Also, there is a data retention policy, the data points will be removed once their lifetime is passed. From another view, a table in TDengine is just a standard message queue. </p>
|
||||||
<p>To reduce the development complexity and improve data consistency, TDengine provides the pub/sub functionality. To publish a message, you simply insert a record into a table. Compared with popular messaging tool Kafka, you subscribe to a table or a SQL query statement, instead of a topic. Once new data points arrive, TDengine will notify the application. The process is just like Kafka. </p>
|
<p>To reduce the development complexity and improve data consistency, TDengine provides the pub/sub functionality. To publish a message, you simply insert a record into a table. Compared with popular messaging tool Kafka, you subscribe to a table or a SQL query statement, instead of a topic. Once new data points arrive, TDengine will notify the application. The process is just like Kafka. </p>
|
||||||
<p>The detailed API will be introduced in the <a href="https://www.taosdata.com/en/documentation/advanced-features/">connectors</a> section. </p>
|
<p>The detailed API will be introduced in the <a href="https://www.taosdata.com/en/documentation/advanced-features/">connectors</a> section. </p>
|
||||||
<a class='anchor' id='Caching'></a><h2>Caching</h2>
|
<a class='anchor' id='Caching'></a><h2>Caching</h2>
|
||||||
|
|
|
@ -54,9 +54,12 @@ char *taosAddIntHash(void *handle, int32_t key, char *pData) {
|
||||||
|
|
||||||
hash = (*pObj->hashFp)(pObj, key);
|
hash = (*pObj->hashFp)(pObj, key);
|
||||||
|
|
||||||
|
pNode = (IHashNode *)malloc(sizeof(IHashNode) + (size_t)pObj->dataSize);
|
||||||
|
if (pNode == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
pthread_mutex_lock(&pObj->mutex);
|
pthread_mutex_lock(&pObj->mutex);
|
||||||
|
|
||||||
pNode = (IHashNode *)malloc(sizeof(IHashNode) + (size_t)pObj->dataSize);
|
|
||||||
pNode->key = key;
|
pNode->key = key;
|
||||||
if (pData != NULL) {
|
if (pData != NULL) {
|
||||||
memcpy(pNode->data, pData, (size_t)pObj->dataSize);
|
memcpy(pNode->data, pData, (size_t)pObj->dataSize);
|
||||||
|
|
Loading…
Reference in New Issue